<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <script src="node_modules/axios/dist/axios.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
    <div id="app">
        <button @click="btnAxios">点击发生axios请求</button>
    </div>
    <script>
        let vue=new Vue({
            el:'#app',
            data(){
                return{

                }
            },
            methods:{
                btnAxios:function(){
                    axios.get('http://localhost:8080/axios',{
                        params:{
                            username:'lisi',
                            id:12
                        }
                    }).then(res=>{
                        console.log(res);
                        console.log(res.data);
                    }).catch(err=>{
                        console.log(err);
                    })
                }
            }
        })
    </script>
</body>
</html>